const Model = require('../lib/model');
const { getXiaomiDatas } = require('../configs/config').api;

class XiaomiData extends Model {
    getXiaomiDatas({ phone, swiper, field }) {
        let url = getXiaomiDatas + `?phone=${phone}&swiper=${swiper}&field=${field}`;
        return this.get(url, {
            success: (data) => {
                return data;
            },
            error: (err) => {
                throw new Error('Error: ' + err);
            }
        })
    }
}

module.exports = new XiaomiData(); 